﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DAL;
using BLL;
public partial class formregister : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    login t = new login();
    user_logindata obj=new user_logindata();
    QlbansachollineDataContext db = new QlbansachollineDataContext();
    protected void Button1_Click(object sender, EventArgs e)
    {obj.username=TextBox2.Text;
        obj.passwords=TextBox3.Text;
        obj.email=TextBox5.Text;
        obj.fullname=TextBox6.Text;
        obj.country=DropDownList1.Text;
       bool ok = db.user_logindatas.Where(nd=>nd.username==TextBox2.Text).FirstOrDefault()!=null?true:false;
       if (!ok)
       {
           t.themnguoidung(obj);
           lblerror.Text = "Thêm thành công";
           
       }
       else lblerror.Text = "Thêm không thành công";
    }
}